package org.reliablesource.prism.ui.viewers;

/**
 *
 *  Copyright (c) 2006, Reliable Source, Inc. All Rights Reserved
 *
 *	Created on: Mar 11, 2006
 *	@author Dennis Park <a href="mailto:dennis.park@gmail.com">dennis.park@gmail.com</a>
 *
 */

import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
import org.reliablesource.prism.core.IPrismElement;
import org.reliablesource.prism.core.IPrismNode;

public class PrismElementLabelProvider extends LabelProvider {

	public String getText(final Object _obj) {
		return ((IPrismElement) _obj).getName();
	}
	public Image getImage(final Object _obj) {
		String imageKey = ISharedImages.IMG_OBJ_FILE;
		if (_obj instanceof IPrismNode)
			imageKey = ISharedImages.IMG_OBJ_FOLDER;
		return PlatformUI.getWorkbench().getSharedImages().getImage(imageKey);
	}
}
